﻿@model MvcWebRole1.Models.PlayerModel

@using MvcWebRole1.Models
@using WordGridGame

@{
    ViewBag.Title = "Word Grid Word Game Sample ";
}
@section featured {
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1>@ViewBag.Title.</h1>
                <h2>@ViewBag.Message</h2>
            </hgroup>
            <p>
                To learn more about ASP.NET MVC visit
                <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
                The page features <mark>videos, tutorials, and samples</mark> to help you get the most from ASP.NET MVC.
                If you have any questions about ASP.NET MVC visit
                <a href="http://forums.asp.net/1146.aspx/1?MVC" title="ASP.NET MVC Forum">our forums</a>.
            </p>
        </div>
    </section>
}

<h2>Games in progress:</h2>
<!-- Show the user's current games if the user is logged in, otherwise show login -->
<ul>
    @{           
        if (Model.GetMyTurnGameNames().Length == 0)
        {
            <li><p>None. Select <a href="~/Board/NewGame">New Game</a> to start one!</p></li>
        }
        else
        {
            for (int index = 0; index < Model.GetMyTurnGameNames().Length; index++)
            {
                int[] gameIds = Model.GetMyTurnGameIDs();
                string[] names = Model.GetMyTurnGameNames();
                <li> <a href="~/Board/Play?gameId=@gameIds[index]"> @names[index] </a> </li>
            }
        }
    }
</ul>